package written_examination;
import java.util.*;

public class Main_11_21_1 {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextInt()){
            int n = scanner.nextInt();
            long[] arr = new long[3 * n];
            for(int i = 0;i < 3 * n;i++){
                arr[i] = scanner.nextLong();
            }
            Arrays.sort(arr);
            long sum = 0;
            for(int i = 0;i < n;i++){
                sum += arr[arr.length - (2 * (i + 1))];
            }
            System.out.println(sum);
        }
    }
}
